<template>
    <div>
        <div class="mui-media-body" id="getnew">
			<h3>{{getNews.title}}</h3>
			<p class="mui-ellipsis">
                <span>发布日期: {{getNews.add_time |dataFormet}}</span>
                <span>点击: 0次</span>
            </p>
            
            <div v-html="getNews.content"></div>

            <div>
                <comment :id="id"></comment>
            </div>
		</div>
    </div>
</template>

<script>
    import comment from '../subcomponents/comment.vue'

export default {
    created(){
        this.getnew()
    },
    data () {
        return {
            id:this.$route.params.id,
            getNews:{}
        }
    },
    methods:{
        getnew(){
            this.$http.get('api/getnew/'+this.id).then((result) => {
                if(result.data.status===0){
                    // console.log(result);
                    this.getNews=result.data.message[0]
                }
            }).catch((err) => {
                
            });
        }
    },
    components:{
        comment
    }
}
</script>

